package com.acsior.hibernate.vo;

import java.util.Date;

import javax.persistence.Column;
import javax.persistence.Entity;
import javax.persistence.FetchType;
import javax.persistence.JoinColumn;
import javax.persistence.ManyToOne;
import javax.persistence.Table;

import com.acsior.dac.impl.hibernate.vo.GeneratorKey;
import com.acsior.dac.impl.hibernate.vo.HibernatePersistantIntegerIdVO;

/**
 * Салдо в оперативна каса
 * 
 * @author Б. Милева 18.06.2012
 */
@Entity
@Table(name = "cash_desk_balances")
@GeneratorKey(tableName = "cash_desk_balances")
public class CashDeskBalanceVO extends HibernatePersistantIntegerIdVO {

	private static final long serialVersionUID = 628671815276877856L;

	@Column(name = "amount", nullable = false, precision = 2)
	private double amount;

	@Column(name = "close_date", nullable = true, length = 23)
	private Date closeDate;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "close_employee_id", nullable = true)
	private EmployeeVO closeEmployee;

	@Column(name = "create_date", nullable = false, length = 23)
	private Date createDate;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "create_employee_id", nullable = false)
	private EmployeeVO createEmployee;

	@Column(name = "is_empty", nullable = false)
	private boolean empty;

	@ManyToOne(fetch = FetchType.LAZY)
	@JoinColumn(name = "sec_workplace_id", nullable = false)
	private SecWorkplaceVO workplace;

	/** default constructor */
	public CashDeskBalanceVO() {
		// empty
	}

	/** @return the amount */
	public double getAmount() {
		return this.amount;
	}

	/** @return the closeDate */
	public Date getCloseDate() {
		return this.closeDate;
	}

	/** @return the closeEmployee */
	public EmployeeVO getCloseEmployee() {
		return this.closeEmployee;
	}

	/** @return the createDate */
	public Date getCreateDate() {
		return this.createDate;
	}

	/** @return the createEmployee */
	public EmployeeVO getCreateEmployee() {
		return this.createEmployee;
	}

	/** @return the workplace */
	public SecWorkplaceVO getWorkplace() {
		return this.workplace;
	}

	/** @return the empty */
	public boolean isEmpty() {
		return this.empty;
	}

	/**
	 * @param amount
	 *            the amount to set
	 */
	public void setAmount(double amount) {
		this.amount = amount;
	}

	/**
	 * @param closeDate
	 *            the closeDate to set
	 */
	public void setCloseDate(Date closeDate) {
		this.closeDate = closeDate;
	}

	/**
	 * @param closeEmployee
	 *            the closeEmployee to set
	 */
	public void setCloseEmployee(EmployeeVO closeEmployee) {
		this.closeEmployee = closeEmployee;
	}

	/**
	 * @param createDate
	 *            the createDate to set
	 */
	public void setCreateDate(Date createDate) {
		this.createDate = createDate;
	}

	/**
	 * @param createEmployee
	 *            the createEmployee to set
	 */
	public void setCreateEmployee(EmployeeVO createEmployee) {
		this.createEmployee = createEmployee;
	}

	/**
	 * @param empty
	 *            the empty to set
	 */
	public void setEmpty(boolean empty) {
		this.empty = empty;
	}

	/**
	 * @param workplace
	 *            the workplace to set
	 */
	public void setWorkplace(SecWorkplaceVO workplace) {
		this.workplace = workplace;
	}
}
